<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>修改自定义页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
		<link rel="stylesheet" href="__JS__/kindeditor/themes/default/default.css" />
		<link rel="stylesheet" href="__JS__/kindeditor/plugins/code/prettify.css" />
		<script charset="utf-8" src="__JS__/kindeditor/kindeditor.js"></script>
		<script charset="utf-8" src="__JS__/kindeditor/lang/zh_CN.js"></script>
		<script charset="utf-8" src="__JS__/kindeditor/plugins/code/prettify.js"></script> 
		<script>
			KindEditor.ready(function(K) {
				var editor1 = K.create('textarea[name="text"]', {
					cssPath : '__JS__/kindeditor/plugins/code/prettify.css',
					uploadJson : '__JS__/kindeditor/php/upload_json.php?no={$no}',
					fileManagerJson : '__JS__/kindeditor/php/file_manager_json.php?no={$no}',
					allowFileManager : true,
					afterCreate : function() {
						var self = this;
						K.ctrl(document, 13, function() {
							self.sync();
							K('form[name=discuss]')[0].submit();
						});
						K.ctrl(self.edit.doc, 13, function() {
							self.sync();
							K('form[name=discuss]')[0].submit();
						});
					}
				});
				prettyPrint();
			});
		</script>
		<load href= "__JS__/jshelper.js" /> 
		<load href="__JS__/jQuery/jquery.js" />
       	<load href="__JS__/jQuery/jquery.form.js" />
       	<script>
		  $(function(){
           $('#form1').ajaxForm({
				//beforeSubmit:  function(){alert("before");},  // pre-submit callback
				success:       complete,  // post-submit callback
				error:function(){alert("error");},
				dataType: 'json'
			});
           
			function complete(data){
			if (data.status==1)
			{
				window.location='__APP__/course/custom/id/{$vo.courseid}/p/{$vo.id}';
             }else{
				$('#result').html(data.info).show();
             }
		}
	});
	</script>
</head>
<body>
<layout name="Auth:header" />
        	<div class="container-fluid">
     			<div class="row-fluid">
                	<layout name="Auth:leftmenu" />
                    	<div class="span8">
                          <div class="hero-unit">
                            <h1>修改自定义页面</h1>
                            <p style="font-size:12px">当前位置：
                                <a href='__APP__/index/index' class="nowpositionhref">主页</a>>
                                <a href='__URL__/index' class="nowpositionhref">后台管理</a>>
                                <a href='__URL__/coursedetail' class="nowpositionhref">课程管理</a>>
                                <a href="__URL__/courseedit" class="nowpositionhref">编辑课程</a>>
                                <a href="" class="nowpositionhref">修改自定义页面</a>
                             </p>
                           </div>
		<form id='form1' name="discuss" method="post" action="__URL__/customupdate" >
			<div id='result' style="color:red; font-size:12px;"></div>
            <input type='hidden' name='id' value={$vo.id}>
			<input type='hidden' name='courseid' value={$vo.courseid}>
              <table class="table table-bordered table-striped">
              	<tr>
                    	<td>
                        页面名称
                        </td>
                        <td>
                         <input type="text" name="name" value={$vo.name} style="width:350px;">
                         </td>
                    </tr>
                    <tr>
                    	<td>
                        	 标题
                         </td>
                         <td>
                			<input type="text" name="topic" value={$vo.topic} style="width:350px;">
                        </td>
                    </tr>
                    <tr>
                    	<td colspan="2">
                        	<textarea name="text" style="width:100%">{$vo.text}</textarea>
                        </td>
                    </tr>
                    <tr>
                    	<td colspan="2">
                        	  <input name="submit" type="submit" value="发表" style="width:80px;" class="btn btn-success" >
                        </td>
                    </tr>
                </table>
		
			<!--页面名称
			<input type="text" name="name" value={$vo.name} style="width:350px;">
			<br>
			 标题
			<input type="text" name="topic" value={$vo.topic} style="width:350px; margin-left:32px;">
			<br>
			<textarea name="text" style="width:700px;hight:1000px;">{$vo.text}</textarea>
			<br>
			<div align="right" style="width:700px">
			<input name="submit" type="submit" value="发表" >
			</div>
            -->
		</form>
       </div>
       </div>
	</div>
</body>
</html>